import React, { Component } from 'react'
// import Taro from '@tarojs/taro'
import { AtImagePicker } from 'taro-ui'
import { View } from '@tarojs/components'

import './index.scss'


class Test extends Component {
  state:any = {
    files: []
  }

  componentDidMount () {
    console.log(2)
  }

  onChange (files) {
    this.setState({
      files
    })
  }
  onFail (mes) {
    console.log(mes)
  }
  onImageClick (index, file) {
    console.log(index, file)
  }
  render () {

    return (
      <View className='test'>
        <AtImagePicker
          length={3}
          files={this.state.files}
          onChange={this.onChange.bind(this)}
          onFail={this.onFail.bind(this)}
          onImageClick={this.onImageClick.bind(this)}
        />

      </View>
    )
  }
}

export default Test
